package com.zy.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

@Controller
@RequestMapping("/aaa")
public class MyController {
    //让接口返回json数据
    @ResponseBody
    @RequestMapping("/bbb")
    public Object getData() {
        HashMap<Object, Object> map = new HashMap<>();
        map.put("name", "tom");
        map.put("age", 22);
        map.put("Address", "河南");
        return map;
    }
}
